package 二叉树;

import Utils.TreeNode;

/**
 * @author: TTDB
 * @create: 2025/9/17
 */
public class invertTree {
    public TreeNode invertTree(TreeNode root) {
        if (root == null) {
            return null;
        }
        TreeNode left = invertTree(root.right);
        TreeNode right = invertTree(root.left);
        root.left = left;
        root.right = right;
        return root;
    }
}
